home *** CD-ROM | disk | FTP | other *** search
/ Mac Magazin/MacEasy 32 / Mac Magazin and MacEasy Magazine CD - Issue 32.iso / Grafik & Text / OzTeX3.0 / TeX-inputs / LaTeX / contrib / float.sty < prev    next >
Text File  |  1997-03-26  |  6KB  |  145 lines

  1. %%
  2. %% This is file `float.sty',
  3. %% generated with the docstrip utility.
  4. %%
  5. %% The original source files were:
  6. %%
  7. %% float.dtx  (with options: `package')
  8. %% 
  9. %% IMPORTANT NOTICE:
  10. %% This file is a stripped version of `float.dtx',
  11. %% copyright (c) 1991-4 by Anselm Lingnau (lingnau@math.uni-frankfurt.de).
  12. %% 
  13. %% You are not allowed to distribute this file.
  14. %% For distribution of the original source see
  15. %% the copyright notice in the source file.
  16. %% 
  17. %% Package `float' to use with LaTeX 2e
  18. %% Copyright (C) 1991-1995 Anselm Lingnau, all rights reserved
  19. %%
  20. %% You may use and distribute this file freely, provided that
  21. %% you don't make any money off it or pretend that you wrote it.
  22. \NeedsTeXFormat{LaTeX2e}[1994/12/01]
  23. \ProvidesPackage{float}
  24.          [1995/03/29 v1.2c Float enhancements (AL)]
  25. \newcounter{float@type}
  26. \@ifundefined{c@figure}%
  27.   {\setcounter{float@type}{1}}%
  28.   {\setcounter{float@type}{4}}
  29. \newcommand\floatstyle[1]{\@ifundefined{fs@#1}%
  30.   {\float@error{#1}}%
  31.   {\def\float@style{#1}}}
  32. \newcommand\float@error[1]{\PackageError{float}{%
  33.   Unknown float style `#1'
  34. }{\@eha}}
  35. \newcommand\floatname[2]{\@namedef{fname@#1}{#2}}
  36. \newcommand\floatplacement[2]{\@namedef{fps@#1}{#2}}
  37. \newcommand\restylefloat[1]{\expandafter\edef\csname
  38.   fst@#1\endcsname{\expandafter\noexpand\csname
  39.     fs@\float@style\endcsname}%
  40.    \@namedef{#1}{\bgroup\@nameuse{fst@#1}\@float{#1}}%
  41.    \@namedef{#1*}{\bgroup\@nameuse{fst@#1}\@dblfloat{#1}}%
  42.    \expandafter\let\csname end#1\endcsname\float@end
  43.    \expandafter\let\csname end#1*\endcsname\float@dblend}
  44. \newcommand\newfloat[3]{\@namedef{ext@#1}{#3}
  45.   \floatplacement{#1}{#2}%
  46.   \@ifundefined{fname@#1}{\floatname{#1}{#1}}{}
  47.   \expandafter\edef\csname ftype@#1\endcsname{\value{float@type}}%
  48.   \addtocounter{float@type}{\value{float@type}}
  49.   \restylefloat{#1}%
  50.   \expandafter\edef\csname fnum@#1\endcsname%
  51.     {\expandafter\noexpand\csname fname@#1\endcsname{}
  52.        \expandafter\noexpand\csname the#1\endcsname}
  53.   \@ifnextchar[{\@xnewfloat{#1}}%
  54.     {\@ifundefined{c@#1}{\newcounter{#1}\@namedef{the#1}{\arabic{#1}}}%
  55.       {}}}
  56. \def\@xnewfloat#1[#2]{\@ifundefined{c@#1}{\newcounter{#1}[#2]%
  57.     \expandafter\edef\csname the#1\endcsname{%
  58.       \expandafter\noexpand\csname
  59.         the#2\endcsname.\noexpand\arabic{#1}}}%
  60.     {\PackageWarning{float}{Can't redefine counter variable for #1.}}}
  61. \let\@Hxfloat\@xfloat
  62. \def\@xfloat#1[{\@ifnextchar{H}{\@HHfloat{#1}[}{\@Hxfloat{#1}[}}
  63. \newsavebox\float@box
  64. \newif\if@flstyle
  65. \def\@HHfloat#1[H]{%
  66.   \expandafter\let\csname end#1\endcsname\float@endH
  67.   \let\@currbox\float@box
  68.   \def\@captype{#1}\setbox\@floatcapt=\vbox{}%
  69.   \expandafter\ifx\csname fst@#1\endcsname\relax
  70.     \@flstylefalse\else\@flstyletrue\fi
  71.   \setbox\@currbox\color@vbox\normalcolor
  72.     \vbox\bgroup \hsize\columnwidth \@parboxrestore
  73.       \reset@font \normalsize \@setnobreak \@setminipage
  74.   \ignorespaces}
  75. \newcommand\float@makebox{%
  76.   \vbox{\hsize\columnwidth \@parboxrestore
  77.     \@fs@pre\@fs@iftopcapt
  78.       \ifvbox\@floatcapt\unvbox\@floatcapt\par\@fs@mid\fi
  79.       \unvbox\@currbox
  80.     \else\unvbox\@currbox
  81.       \ifvbox\@floatcapt\par\@fs@mid\unvbox\@floatcapt\fi
  82.     \fi\par\@fs@post\vskip\z@}}
  83. \newcommand\float@end{\global\@minipagefalse \outer@nobreak
  84.   \egroup \color@endbox
  85.   \global\setbox\@currbox\float@makebox
  86.    \ifnum\@floatpenalty <\z@ \@largefloatcheck
  87.     \@cons\@currlist\@currbox
  88.      \ifnum\@floatpenalty < -\@Mii
  89.         \penalty -\@Miv \@tempdima\prevdepth
  90.         \vbox{}\prevdepth \@tempdima \penalty\@floatpenalty
  91.       \else \vadjust{\penalty -\@Miv
  92.         \vbox{}\penalty\@floatpenalty}\@Esphack
  93.      \fi\fi\egroup}
  94. \newcommand\float@endH{\par\vskip\z@skip
  95.     \global\@minipagefalse \outer@nobreak
  96.   \egroup \color@endbox \vskip\intextsep
  97.   \if@flstyle\float@makebox\egroup\else\box\@currbox\fi
  98.   \vskip\intextsep\relax}
  99. \newcommand\float@dblend{\if@twocolumn
  100.   \par\vskip\z@\egroup \outer@nobreak \color@endbox
  101.   \ifnum\@floatpenalty <\z@ \@largefloatcheck
  102.     \@cons\@dbldeferlist\@currbox\fi
  103.     \ifnum \@floatpenalty =-\@Mii \@Esphack\fi\egroup\else\float@end\fi}
  104. \newsavebox\@floatcapt
  105. \renewcommand\caption{\refstepcounter\@captype
  106.   \expandafter\ifx\csname fst@\@captype\endcsname\relax
  107.       \let\@tempf\@caption
  108.     \else\let\@tempf\float@caption\fi \@dblarg{\@tempf\@captype}}
  109. \long\def\float@caption#1[#2]#3{\addcontentsline{\@nameuse{ext@#1}}{#1}%
  110.    {\protect\numberline{\@nameuse{the#1}}{\ignorespaces #2}}
  111.   \global\setbox\@floatcapt\vbox\bgroup\@parboxrestore
  112.     \normalsize\@fs@capt{\@nameuse{fnum@#1}}{\ignorespaces #3}%
  113.     \@ifnextchar[{\float@ccon}{\egroup}}
  114. \long\def\float@ccon[#1]{#1\par\egroup}
  115. \newcommand\listof[2]{%
  116.   \@ifundefined{ext@#1}{\float@error{#1}}{%
  117.     \@ifundefined{chapter}{\def\@tempa{\section*}}%
  118.       {\def\@tempa{\chapter*}}%
  119.     \@tempa{#2\@mkboth{\uppercase{#2}}{\uppercase{#2}}}%
  120.     \@namedef{l@#1}{\@dottedtocline{1}{1.5em}{2.3em}}%
  121.     \@starttoc{\@nameuse{ext@#1}}}}
  122. \newcommand\floatc@plain[2]{\setbox\@tempboxa\hbox{{\@fs@cfont #1:} #2}%
  123.   \ifdim\wd\@tempboxa>\hsize {\@fs@cfont #1:} #2\par
  124.     \else\hbox to\hsize{\hfil\box\@tempboxa\hfil}\fi}
  125. \newcommand\fs@plain{\def\@fs@cfont{\rmfamily}\let\@fs@capt\floatc@plain
  126.   \def\@fs@pre{}\def\@fs@post{}\def\@fs@mid{\vspace{10pt}\relax}%
  127.   \let\@fs@iftopcapt\iffalse}
  128. \newcommand\floatc@ruled[2]{{\@fs@cfont #1} #2\par}
  129. \newcommand\fs@ruled{\def\@fs@cfont{\bfseries}\let\@fs@capt\floatc@ruled
  130.   \def\@fs@pre{\hrule height.8pt depth0pt \kern2pt}%
  131.   \def\@fs@post{\kern2pt\hrule\relax}%
  132.   \def\@fs@mid{\kern2pt\hrule\kern2pt}%
  133.   \let\@fs@iftopcapt\iftrue}
  134. \newcommand\fs@boxed{\def\@fs@cfont{\bfseries}\let\@fs@capt\floatc@plain
  135.   \def\@fs@pre{\setbox\@currbox\vbox{\hbadness10000
  136.     \moveleft3.4pt\vbox{\advance\hsize by6.8pt
  137.       \hrule \hbox to\hsize{\vrule\kern3pt
  138.         \vbox{\kern3pt\box\@currbox\kern3pt}\kern3pt\vrule}\hrule}}}%
  139.   \def\@fs@mid{\kern2pt}%
  140.   \def\@fs@post{}\let\@fs@iftopcapt\iffalse}
  141. \floatstyle{plain}
  142. \endinput
  143. %%
  144. %% End of file `float.sty'.
  145.